import org.junit.Test;

/*
Author     :Dsi
Date       : 2021/11/27 12:43
Description: 
*/
class Demo {

}
public class LinkNode<T> {

    public LinkNode(LinkNode<T> next, LinkNode<T> previous, T obj) {
        this.next = next;
        this.previous = previous;
        this.obj = obj;
        System.out.println("diaoyongle");
    }

    private LinkNode<T> next;//下一个节点
    private LinkNode<T> previous;//上一个节点
    private T obj;
    /**
     * 删除节点
     */
    public void remove() {
        System.out.println(1+1);
        next.previous = previous;
        previous.next = next;
    }
    /**
     * 修改节点
     */
    public void set(T t) {
        LinkNode<T> link = new LinkNode<T>(next, previous, t);
        next.previous = link;
        previous.next = link;
    }

    public String toString() {
        return obj.toString();
    }
}